#ifndef MODEL_H
#define MODEL_H

//build assimp: -DBUILD_SHARED_LIBS=OFF

#include <assimp/scene.h>
#include "mesh.h"

class Model
{
public:
    Model();
    ~Model();

    GLboolean loadModel(const QString &file, GLboolean gamma = GL_FALSE);
    void draw();

private:
    void processNode(aiNode *node, const aiScene *scene);
    Mesh *processMesh(aiMesh *mesh, const aiScene *scene);
    QVector<Texture> loadMaterialTextures(aiMaterial *mat, aiTextureType type, QString typeName);

private:
    QString directory;
    QVector<Mesh *> meshes;
    QVector<Texture> texturesLoaded;
    bool gammaCorrection;
};

#endif // MODEL_H
